package org.dromara.wms.domain;

  import org.dromara.common.tenant.core.TenantEntity;
import com.alibaba.excel.annotation.ExcelProperty;
  import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import jakarta.validation.constraints.*;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

  import java.io.Serial;

/**
 * 出入库记录台账对象 wms_stock_log
 *
 * @author wenrui Su
 * @date 2024-05-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_stock_log")
public class WmsStockLog extends TenantEntity {

@Serial
private static final long serialVersionUID=1L;


  @ExcelProperty(value = "事务ID")
  @TableId(value = "id")
  private Long id;

  @ExcelProperty(value = "物品id")
  @NotNull(message = "物品id不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long productId;

  @ExcelProperty(value = "单位")
  @NotBlank(message = "单位不能为空", groups = { AddGroup.class, EditGroup.class })
  private String measureUnit;

  @ExcelProperty(value = "批次号")
  @NotBlank(message = "批次号不能为空", groups = { AddGroup.class, EditGroup.class })
  private String batchCode;

  @ExcelProperty(value = "单据号")
  @NotNull(message = "单据号不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long orderId;

  @ExcelProperty(value = "单据类别")
  private Long typeId;

  @ExcelProperty(value = "单价")
  @NotNull(message = "单价不能为空", groups = { AddGroup.class, EditGroup.class })
  private Double price;

  @ExcelProperty(value = "仓库ID")
  @NotNull(message = "仓库ID不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long warehouseId;

  @ExcelProperty(value = "库位ID")
  private Long areaId;

  @ExcelProperty(value = "操作前")
  private Double quantityBefore;

  @ExcelProperty(value = "操作数量")
  @NotNull(message = "操作数量不能为空", groups = { AddGroup.class, EditGroup.class })
  private Double quantityAfter ;

  @ExcelProperty(value = "备注")
  private String remark;

  @ExcelProperty(value = "产品名")
  @TableField(exist = false)
  private String productName;

  @ExcelProperty(value = "仓库名")
  @TableField(exist = false)
  private String warehouseName;
}
